import App from './App'

import $config from './common/config.js'
import $api from './common/api.js'
import $func from './common/func.js'
import $store from './common/store.js'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'

Vue.config.productionTip = false

App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
//全局挂载
// Vue.prototype.$config = $config
// Vue.prototype.$api = $api
// Vue.prototype.$func = $func

export function createApp() {
	const app = createSSRApp(App)
	// 全局配置
	app.config.globalProperties.$config = $config
	app.config.globalProperties.$api = $api
	app.config.globalProperties.$func = $func
	app.config.globalProperties.$store = $store
	app.use($store)
	return {
		$store,
		app
	}
}
// #endif


